<?php

require_once("../../class2.php");
require_once(HEADERF);
		$user_id = USERID;
		$user_name = USERNAME;
require_once("./includes/require_all.php");

	$delimiter= mysql_real_escape_string($_GET['limit']);
	$start= ($_GET['pager']-1)*$delimiter;
	$tempo= mysql_query("SELECT * FROM cms_gamenews ORDER BY date DESC LIMIT $start, $delimiter");
	echo "<div id='result'>";
	while ($neww= mysql_fetch_array($tempo)) {
		if ($_GET['frntpg']=='yes') {
			$datee= months_inBG(date("j F : H:i", strtotime($neww['date'])));
			echo "<div class='forumheader2'>
					<span class='textWHITE'>$neww[game]</span>
					<span class='smalltext' style='vertical-align:middle;'>($datee)</span>
					: <i>$neww[message]</i>
				  </div>";
		}
		else {
			$datee= date("j.m", strtotime($neww['date']));
			echo "<div class='forumheader3'>
					<b style='font-size:14px'><u>$neww[game]</u></b> <span style='float:right;' class='forumheader2'>$datee ($neww[user])</span><br>
					$neww[message]
				  </div>";
		}
	}
	$rowss= mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM cms_gamenews"));
	$alphatotal= ceil($rowss[0]/$delimiter);
	$alphacurrent= $_GET['pager'];
	$alphastart= $alphacurrent-10; if ($alphastart<1) $alphastart=1;
	$alphaend= $alphacurrent+10; if ($alphaend>$alphatotal) $alphaend=$alphatotal;
	echo "<div class='forumheader3'>";
		while ($alphastart<=$alphaend) {
			if ($alphastart==$alphacurrent) $addd="textGREY"; else $addd="";
			if ($_GET['frntpg']=='yes') {
				echo "<span onclick=\"$('#sysnews').load('translations/cms/intranslations-exec.php?limit=$delimiter&pager=$alphastart&frntpg=yes'+' '+'#result');\" class='unselectable button $addd'>$alphastart</span>";
			}
			else {
				echo "<span onclick=insertFromURL('intranslations-exec.php?limit=$delimiter&pager=$alphastart','#result','#newsss') class='unselectable button $addd'>$alphastart</span>";
			}
			$alphastart++;
		}
	echo "</div></div>";
?>
			  
			